ostree-prepare-root: Refactor: Create /sysroot.tmp much later
authorWilliam Manley <will@williammanley.net>
Mon, 18 Jul 2016 17:02:12 +0000 (18:02 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 2 Aug 2016 19:07:25 +0000 (19:07 +0000)
commit47e7afab272721fdfa046aa22ee5260ce64d5541
tree4f3c00bb0aec3062671d4df0d2de2cf202ad4ba2
parenta0a4052365288d32c682baa7b6477645130c265e
ostree-prepare-root: Refactor: Create /sysroot.tmp much later

Typically we have our ready made-up up root at
`/sysroot/ostree/deploy/.../` (`deploy_path`) and the real rootfs at
`/sysroot` (`root_mountpoint`).  We want to end up with our made-up root
at `/sysroot/` and the real rootfs under `/sysroot/sysroot` as systemd
will be responsible for moving `/sysroot` to `/`.

We need to do this in 3 moves to avoid trying to move `/sysroot` under
itself:

1. `/sysroot/ostree/deploy/...` -> `/sysroot.tmp`
2. `/sysroot` -> `/sysroot.tmp/sysroot`
3. `/sysroot.tmp` -> `/sysroot`

This is a refactoring to group all these operations together so I can
implement an alternative in terms of `pivot_root`.

Closes: #403
Approved by: cgwalters
src/switchroot/ostree-prepare-root.c